package com.nsgf.library.data.bean;

import android.graphics.drawable.Drawable;

import com.google.gson.annotations.SerializedName;
import com.nsgf.library.base.BaseApplication;
import com.nsgf.library.data.api.APIs;
import com.nsgf.library.utils.Kits;
import com.nsgf.library.widget.prckerview.model.IPickerViewData;
import com.zhht.htzx.R;

import java.util.List;

public class BusinessBean implements IPickerViewData {


    private String userType;
    private String id;
    private String name;
    private Integer contactUserId;
    private String contactName;
    private String contactMobile;
    private Integer status;
    private String website;
    private Integer packageId;
    private Long expireTime;
    private Integer accountCount;
    private Integer zhhtMerchantsType;
    private Long createTime;
    private Long updateTime;
    private String creator;
    private String updater;
    private Boolean deleted;
    private String avatar;
    private String address;
    private String typeName;
    private List<ProductListBean> productList;
    private int applyStatus;

    private String typeId;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getContactUserId() {
        return contactUserId;
    }

    public void setContactUserId(Integer contactUserId) {
        this.contactUserId = contactUserId;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactMobile() {
        return contactMobile;
    }

    public void setContactMobile(String contactMobile) {
        this.contactMobile = contactMobile;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getWebsite() {
        return website;
    }

    public void setWebsite(String website) {
        this.website = website;
    }

    public Integer getPackageId() {
        return packageId;
    }

    public void setPackageId(Integer packageId) {
        this.packageId = packageId;
    }

    public Long getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Long expireTime) {
        this.expireTime = expireTime;
    }

    public Integer getAccountCount() {
        return accountCount;
    }

    public void setAccountCount(Integer accountCount) {
        this.accountCount = accountCount;
    }

    public Integer getZhhtMerchantsType() {
        return zhhtMerchantsType;
    }

    public void setZhhtMerchantsType(Integer zhhtMerchantsType) {
        this.zhhtMerchantsType = zhhtMerchantsType;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public String getCreateTimeSrc() {
        return "提交时间：" + Kits.Date.getYmdhhms(createTime);
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getUpdater() {
        return updater;
    }

    public void setUpdater(String updater) {
        this.updater = updater;
    }

    public Boolean isDeleted() {
        return deleted;
    }

    public void setDeleted(Boolean deleted) {
        this.deleted = deleted;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public List<ProductListBean> getProductList() {
        return productList;
    }

    public void setProductList(List<ProductListBean> productList) {
        this.productList = productList;
    }

    public String getTypeId() {
        return typeId;
    }

    public void setTypeId(String typeId) {
        this.typeId = typeId;
    }

    @Override
    public String getPickerViewText() {
        return getName();
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public int getApplyStatus() {
        return applyStatus;
    }

    public Drawable getApplyStatusLogo() {

        switch (getApplyStatus()) {
            case 0:
                return BaseApplication.getInstance().getResources().getDrawable(R.drawable.ic_business_status_process);
            case 1:
                return BaseApplication.getInstance().getResources().getDrawable(R.drawable.ic_business_status_success);
            case 3:
                return BaseApplication.getInstance().getResources().getDrawable(R.drawable.ic_business_status_fail);
        }
        return BaseApplication.getInstance().getResources().getDrawable(R.drawable.ic_business_status_process);
    }
    public String getApplyStatusSrc() {
        switch (getApplyStatus()) {
            case 0:
                return "";
            case 1:
                return "审核成功";
            case 2:
                return "审核中";
        }
        return "";
    }

    public void setApplyStatus(int applyStatus) {
        this.applyStatus = applyStatus;
    }

    public static class ProductListBean {
        @SerializedName("zhhtMerchantsType")
        private int zhhtMerchantsTypeX;
        @SerializedName("id")
        private String idX;
        private String tenantName;
        private String productName;
        private double price;
        private Object freeShipping;
        private String picUrl;

        public int getZhhtMerchantsTypeX() {
            return zhhtMerchantsTypeX;
        }

        public void setZhhtMerchantsTypeX(int zhhtMerchantsTypeX) {
            this.zhhtMerchantsTypeX = zhhtMerchantsTypeX;
        }

        public String getIdX() {
            return idX;
        }

        public void setIdX(String idX) {
            this.idX = idX;
        }

        public String getTenantName() {
            return tenantName;
        }

        public void setTenantName(String tenantName) {
            this.tenantName = tenantName;
        }

        public String getProductName() {
            return productName;
        }

        public void setProductName(String productName) {
            this.productName = productName;
        }

        public String getPrice() {
            return "￥" + APIs.df.format(price / 100);
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public Object getFreeShipping() {
            return freeShipping;
        }

        public void setFreeShipping(Object freeShipping) {
            this.freeShipping = freeShipping;
        }

        public String getPicUrl() {
            return picUrl;
        }

        public void setPicUrl(String picUrl) {
            this.picUrl = picUrl;
        }
    }
}
